<?php
/*
 * 进云智能生成平台
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
 */

defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$return['setting']=$this->plugin_setting('basic');
$uniacid=$_SESSION['uniacid'];
if($_RQ['op']=='main'){
	$member=pdo_get('core_members',array('uniacid'=>$_SESSION['uniacid'],'id'=>$_SESSION['uid']));
	$zhuhu=pdo_get('jy_smallquan_household',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['mid']));
	$acount=pdo_count('jy_smallquan_advise',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']));
	$return['post']=array();
	$return['member']=$member;
	$return['zhuhu']=$zhuhu;
	$return['acount']=$acount;
	
	exi($return);
}

if($_RQ['op']=='post'){
	$post=get_postdata();
	$insert=array(
		'uniacid'=>$_SESSION['uniacid'],
		'mid'=>$_SESSION['uid'],
		'title'=>trim($post['title']),
		'content'=>trim($post['content']),
		'status'=>1,
		'createtime'=>TIMESTAMP,
	);
	pdo_insert('jy_smallquan_advise',$insert);
	$return['success']=1;
	exi($return);
}
		
		


